package com.ht.medicaltreatment.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.ht.medicaltreatment.R
import com.ht.medicaltreatment.bean.BorrowPage
import com.ht.medicaltreatment.bean.PDPage

class BorrowAdapter : BaseQuickAdapter<BorrowPage,BaseViewHolder>(R.layout.item_borrow_layout) {

    init {
        addChildClickViewIds(R.id.tvDelete,R.id.tvChange,R.id.llTab)
    }

    override fun convert(holder: BaseViewHolder, item: BorrowPage) {
        holder.setText(R.id.tvCode,"${getItemPosition(item)+1}")
        holder.setText(R.id.tvName,item.orderName)
        if(item.status == 0){
            holder.setText(R.id.tvStatus,"未核验")
            holder.setGone(R.id.tvDelete,false)
            holder.setGone(R.id.tvChange,false)
        }else if(item.status == 1){
            holder.setText(R.id.tvStatus,"已核验")
            holder.setGone(R.id.tvChange,true)
            holder.setGone(R.id.tvDelete,true)
        }
    }
}
